﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Eis51.CampanyCMS.Business.Bus;
using Eis51.CampanyCMS.Model;
using Eis51.CampanyCMS.Model.Bus;
using Eis51.CampanyCMS.FrameWork;
using Eis51.Web.Admin;

namespace Eis51.CampanyCMS.WebUI.Admin.SystemManager
{
    public partial class PEmailSever : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ShowData();
            }
        }

        private void ShowData()
        {
            Emailsever  emailsever=EmailseverBLL.GetInstance().GetEmailseverByCreateBy(AppContext.CurrentAdministrator.Createby);
            if (emailsever!=null)
                UControl.CopyEntityToControl(this.Page.Form, emailsever);
        
        }
        private void Save()
        { 
             Emailsever  emailsever=EmailseverBLL.GetInstance().GetEmailseverByCreateBy(AppContext.CurrentAdministrator.Createby);
             if (emailsever == null)
             {
                 emailsever = new Emailsever();
             }
             UControl.CopyControlToEntity(this.Page.Form, emailsever);
             EmailseverBLL.GetInstance().Subimt(emailsever);
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            Save();
            BaseTools.ShowMessage(this.Page, "修改成功！");
        }
    }
}
